
package vip.xiaonuo.biz.modular.devicereservation.task;

import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
import vip.xiaonuo.biz.modular.devicereservation.service.DeviceReservationStatusService;
import vip.xiaonuo.common.timer.CommonTimerTaskRunner;

/**
 * 设备预约状态定时任务
 *
 * @author Blurryface
 * @date 2025/04/27 14:47
 **/
@Slf4j
@Component
public class DeviceReservationStatusTimerTaskRunner implements CommonTimerTaskRunner {

    @Resource
    private DeviceReservationStatusService deviceReservationStatusService;

    @Override
    public void action(String extJson) {
        // log.info("设备预约状态定时任务开始执行...");
        try {
            // 处理延时队列中的过期预约
            deviceReservationStatusService.processDelayQueue();
        } catch (Exception e) {
            log.error("设备预约状态定时任务执行异常：", e);
        }
        // log.info("设备预约状态定时任务执行完成");
    }
}